package com.bolun998300.personal_blog_springboot.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bolun998300.personal_blog_springboot.dao.TagDao;
import com.bolun998300.personal_blog_springboot.pojo.Tag;

@Service
public class TagService {

	@Autowired
	private TagDao tagDao;
	
	public Tag get(String tagName) {
		return tagDao.findByTagName(tagName);
	}
	
	public void add(Tag bean) {
		tagDao.save(bean);
	}
	
	public Tag getById(int id) {
		return tagDao.findOne(id);
	}
	
	public List<Tag> list(){
		return tagDao.findAll();
	}
	
	
	
	
}
